(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/storehouse/scanIn"], {
        3099: function (t, e, o) {},
        "391c": function (t, e, o) {
            "use strict";
            o.r(e);
            var n = o("a99e"),
                a = o.n(n);
            for (var s in n)["default"].indexOf(s) < 0 && function (t) {
                o.d(e, t, (function () {
                    return n[t]
                }))
            }(s);
            e["default"] = a.a
        },
        "521c": function (t, e, o) {
            "use strict";
            o.r(e);
            var n = o("b568"),
                a = o("391c");
            for (var s in a)["default"].indexOf(s) < 0 && function (t) {
                o.d(e, t, (function () {
                    return a[t]
                }))
            }(s);
            o("e291");
            var i = o("f0c5"),
                r = Object(i["a"])(a["default"], n["b"], n["c"], !1, null, "872bbf6c", null, !1, n["a"], void 0);
            e["default"] = r.exports
        },
        a99e: function (t, e, o) {
            "use strict";
            (function (t) {
                var n = o("4ea4");
                Object.defineProperty(e, "__esModule", {
                    value: !0
                }), e.default = void 0;
                var a = n(o("2eee")),
                    s = n(o("c973")),
                    // i = t.requireNativePlugin("wyQrCodeModule"),
                    r = {
                        components: {
                            dtSelect: function () {
                                o.e("components/dt-select/dt-select").then(function () {
                                    return resolve(o("9fbf"))
                                }.bind(null, o)).catch(o.oe)
                            }
                        },
                        data: function () {
                            return {
                                scanInState: !1,
                                dataList: [],
                                isAutoScan: !1,
                                url: getApp().globalData.apiurl,
                                storageList: [],
                                areaList: [],
                                goodsno: "",
                                rkno: "",
                                goodsname: "",
                                specifications: "",
                                goods: [],
                                listData: {
                                    goodsname: "",
                                    specifications: "",
                                    rkno: ""
                                },
                                model: {
                                    materialCode: "",
                                    materialStorage: "",
                                    materialArea: ""
                                },
                                rules: {
                                    materialCode: {
                                        rules: [{
                                            required: !0,
                                            errorMessage: "请扫码"
                                        }]
                                    },
                                    materialStorage: {
                                        rules: [{
                                            required: !0,
                                            errorMessage: "请选择库房"
                                        }]
                                    },
                                    materialArea: {
                                        rules: [{
                                            required: !0,
                                            errorMessage: "请选择区域"
                                        }]
                                    }
                                }
                            }
                        },
                        onLoad: function (t) {
                            this.init(), this.startScan(), this.initData()
                        },
                        onUnload: function () {
                            this.stopScan(), this.release()
                        },
                        methods: {
                            testGet: function () {
                                this.getToast("请重新登录系统！", !1)
                            },
                            getIn: function () {
                                console.log("调用激光扫头"), this.startScan()
                            },
                            init: function () {
                                var t = this;
                                i.initQrcode((function (e) {
                                    if (!e) return t.getToast("请重新登录系统！", !1)
                                }))
                            },
                            getToast: function (t, e) {
                                plus.nativeUI.toast('<font style="font-size:32px">' + t + "</font>", {
                                    verticalAlign: "center",
                                    type: "richtext",
                                    icon: e ? "/static/icon/success.png" : "/static/icon/error.png",
                                    duration: "short",
                                    richTextStyle: {
                                        align: "center",
                                        fontSrc: "static/font/...otf"
                                    }
                                })
                            },
                            startScan: function () {
                                var t = this;
                                i.startScan(this.isAutoScan, (function (e) {
                                    if (t.scanInState) {
                                        if (console.log("二维码中数据：" + e), "" == t.model.materialStorage) return t.getToast("请选择库房", !1);
                                        if ("" == t.model.materialArea) return t.getToast("请选择区域", !1);
                                        if (!e) return t.getToast("失败！请联系管理员");
                                        t.saomiao(e)
                                    } else t.scanInState = !0
                                }))
                            },
                            stopScan: function () {
                                i.stopScan()
                            },
                            release: function () {
                                i.releaseQrcode()
                            },
                            initData: function () {
                                var e = this;
                                return (0, s.default)(a.default.mark((function o() {
                                    return a.default.wrap((function (o) {
                                        while (1) switch (o.prev = o.next) {
                                            case 0:
                                                t.request({
                                                    url: e.url + "warehouse/warehouse/getTreeWarehouseList",
                                                    method: "GET",
                                                    data: {},
                                                    success: function (t) {
                                                        e.storageList = t.data.data
                                                    }
                                                });
                                            case 1:
                                            case "end":
                                                return o.stop()
                                        }
                                    }), o)
                                })))()
                            },
                            saomiao: function (e) {
                                var o, n = this,
                                    a = e + "";
                                if (o = a.split("no="), 3 != o.length) return this.getToast("二维码无效！", !1);
                                this.goodsno = o[1], this.rkno = o[2], this.model.materialCode = this.rkno, t.request({
                                    url: this.url + "goodsmaintain/goods/list",
                                    method: "GET",
                                    data: {
                                        type: "2",
                                        goodsno: this.goodsno
                                    },
                                    success: function (t) {
                                        n.goods = t.data.rows, console.log(t.data.rows[0].goodsname), n.goodsname = t.data.rows[0].goodsname, n.specifications = t.data.rows[0].specifications
                                    },
                                    complete: function () {
                                        n.submitForm()
                                    }
                                })
                            },
                            biangeng: function (e) {
                                var o = this;
                                console.log(e);
                                var n = e;
                                t.request({
                                    url: this.url + "warehouseregion/warehouseregion/list",
                                    method: "GET",
                                    data: {
                                        warehouseno: n
                                    },
                                    success: function (t) {
                                        o.areaList = t.data.rows
                                    },
                                    fail: function () {},
                                    complete: function () {
                                        console.log(o.areaList), o.model.materialArea = o.areaList[0].regionno
                                    }
                                })
                            },
                            submitForm: function () {
                                var e = this;
                                console.log("进入提交操作");
                                var o = this,
                                    n = getApp().globalData.userinfo.nickName;
                                t.request({
                                    url: this.url + "receiptdoc/receiptdoc/list",
                                    method: "GET",
                                    data: {
                                        receiptdocno: this.rkno
                                    },
                                    success: function (i) {
                                        i.data.rows.length > 0 ? (e.getToast("请勿重复入库", !1), e.clearFrom()) : o.$refs.form.validate().then(function () {
                                            var i = (0, s.default)(a.default.mark((function s(i) {
                                                return a.default.wrap((function (a) {
                                                    while (1) switch (a.prev = a.next) {
                                                        case 0:
                                                            t.request({
                                                                url: e.url + "receiptdoc/receiptdoc/insertReceiptdoc",
                                                                method: "GET",
                                                                data: {
                                                                    goodsno: o.goodsno,
                                                                    receiptdocno: o.rkno,
                                                                    goodsname: e.goods[0].goodsname,
                                                                    specifications: e.goods[0].specifications,
                                                                    regionno: e.model.materialArea,
                                                                    createordno: n
                                                                },
                                                                success: function (t) {
                                                                    e.getToast("入库成功！", !0), e.clearFrom()
                                                                }
                                                            });
                                                        case 1:
                                                        case "end":
                                                            return a.stop()
                                                    }
                                                }), s)
                                            })));
                                            return function (t) {
                                                return i.apply(this, arguments)
                                            }
                                        }()).catch((function (t) {
                                            console.error(t)
                                        }))
                                    }
                                })
                            },
                            clearFrom: function () {
                                this.goodsno = "", this.rkno = "", this.goods = [], this.listData.goodsname = "", this.listData.specifications = "", this.listData.rkno = "", this.model.materialCode = ""
                            },
                            scanCode: function () {
                                var e = this;
                                t.scanCode({
                                    success: function (t) {
                                        console.log("条码类型", t.scanType), console.log("条码内容", t.result), e.model.materialCode = t.result
                                    }
                                })
                            },
                            storageChange: function (t) {
                                console.log(t)
                            }
                        }
                    };
                e.default = r
            }).call(this, o("543d")["default"])
        },
        b568: function (t, e, o) {
            "use strict";
            o.d(e, "b", (function () {
                return a
            })), o.d(e, "c", (function () {
                return s
            })), o.d(e, "a", (function () {
                return n
            }));
            var n = {
                    uniForms: function () {
                        return Promise.all([o.e("common/vendor"), o.e("components/uni-forms/uni-forms")]).then(o.bind(null, "0933"))
                    },
                    uniFormsItem: function () {
                        return o.e("components/uni-forms-item/uni-forms-item").then(o.bind(null, "4828"))
                    },
                    dtSelect: function () {
                        return o.e("components/dt-select/dt-select").then(o.bind(null, "9fbf"))
                    }
                },
                a = function () {
                    var t = this.$createElement;
                    this._self._c
                },
                s = []
        },
        ca9c: function (t, e, o) {
            "use strict";
            (function (t, e) {
                var n = o("4ea4");
                o("c150"), o("5c17"), o("a9ff");
                n(o("66fd"));
                var a = n(o("521c"));
                t.__webpack_require_UNI_MP_PLUGIN__ = o, e(a.default)
            }).call(this, o("bc2e")["default"], o("543d")["createPage"])
        },
        e291: function (t, e, o) {
            "use strict";
            var n = o("3099"),
                a = o.n(n);
            a.a
        }
    },
    [
        ["ca9c", "common/runtime", "common/vendor"]
    ]
]);